<!DOCTYPE html>
<html lang="en">

	<include file="Public:header" />
	<include file="Public:page_css" />

	<body class="fixed-sidebar full-height-layout gray-bg" style="overflow:hidden">

		<include file="Public:nav" />

		<div class="row">
			<div class="col-sm-12">
				<div class="ibox float-e-margins">
					<div class="ibox-content no-padding">
						<ul class="list-group">
							<li class="list-group-item">
								<p class="text-success"><a href="{:U('Index/index')}" title="返回首页" class="tip-bottom"><i class="fa fa-home"></i> 首页</a> /
									<a href="#" class="tip-bottom"> 本地生活</a> / <a href="{:U('Life/index')}" class="tip-bottom">分类管理</a></p>
							</li>
						</ul>
					</div>
				</div>
			</div>
		</div>
		<a href="{:U('Life/addtype')}" class="btn btn-primary">添加一级分类</a>
		<br />
		<br />
		<div class="row">
			<div class="col-sm-12">
				<div class="ibox float-e-margins">
					<div class="ibox-title">
						<h5><i class="fa fa-tasks"></i> 分类管理</h5>
					</div>
					<div class="ibox-content">
						<table class="table table-bordered">
							<thead>
								<tr class="long-tr">
									<th>编号</th>
									<th>分类名称</th>
									<th>排序</th>
									<th>操作</th>
								</tr>
							</thead>
							<tbody>
								<foreach name="list1" item="var1">
			                        <tr class="long-td">
			                            <td style="text-align: center;">{$var1.cate_id}</td>
			                            <td style="text-align: center;">{$var1.cate_name}</td>
			                            <td style="text-align: center;">{$var1.orderby}</td>
			                            <td style="text-align: center;">
											<a href="{:U('life/addSubtype',array('cate_id'=>$var1['cate_id']))}">添加子分类</a>&nbsp;&nbsp;| 
											<a href="{:U('life/edittype',array('cate_id'=>$var1['cate_id']))}">编辑</a>&nbsp;&nbsp;|
											<a onClick="return confirm('删除一级分类会将下面的所有二级分类全部删除\n您确定要删除吗?')" href="{:U('life/delSubtype',array('cate_id'=>$var1['cate_id']))}">删除</a>
										</td>                      
			                        </tr>
			                         <foreach name="list2" item="var2">
			                            <if condition="$var2.pid eq $var1.cate_id ">
			                                <tr class="long-td">
			                                    <td style="text-align: center;">{$var2.cate_id}</td>
			                            		<td style="text-align: center;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|----{$var2.cate_name}</td>
			                            		<td style="text-align: center;">{$var2.orderby}</td>
			                                    <td style="text-align: center;">
													<a href="{:U('life/editSubtype',array('cate_id'=>$var2['cate_id']))}">编辑</a>&nbsp;&nbsp;|
													<a onClick="return confirm('您确定要删除吗?')" href="{:U('life/deltype',array('cate_id'=>$var2['cate_id']))}">删除</a>
			                                    </td>                         
			                                </tr>
			                 
			                             </if>
			                         </foreach>
			                    </foreach>
							</tbody>
						</table>
					</div>
				</div>
			</div>
		</div>
		<include file="Public:footer" />
	</body>

</html>